//
//  WWDCWindowController.swift
//  WWDCLearn
//
//  Created by mac on 2021/6/30.
//

import Cocoa





class WWDCWindowController: NSWindowController {
    var titleBarViewController = TitleBarViewController()
    override var windowNibName: NSNib.Name? {
        return NSNib.Name("")
    }
    init(){
        super.init(window: nil)
    }

    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override func loadWindow() {
        fatalError("loadWindow must be overriden by subclasses")
    }
    override func windowDidLoad() {
        super.windowDidLoad()
        window?.titleVisibility = .hidden
        window?.addTitlebarAccessoryViewController(titleBarViewController)
        window?.toolbar = NSToolbar(identifier: "DummyToolbar")
        if #available(macOS 11.0, *) {
            window?.titlebarAppearsTransparent = true
        }
    }

}
